package main

import (
  "fmt"
  "sort"
)

func p1() {
  var a []string = make([]string, 5, 10)
  fmt.Println("a:", a)
  for i := 0; i < 10; i++ {
    a = append(a, fmt.Sprintf("%d", i))
  }
  fmt.Println("a:", a)
  /*
     a: [    ]
     a: [     0 1 2 3 4 5 6 7 8 9]
  */
}

//数组升降排序
func p2() {
  var a = [5]int{5, 4, 3, 2, 1}
  sort.Ints(a[:])
  fmt.Println("a:",a) //a: [1 2 3 4 5]

  var b = [5]string{"ac","ec","be","fa","ii"}
  sort.Strings(b[:])
  fmt.Println("b:",b) //b: [ac be ec fa ii]


  var c = [5]float64{29.38,22.32,0.8,99191.2}
  sort.Float64s(c[:])
  fmt.Println("c:",c) //c: [0 0.8 22.32 29.38 99191.2]
}

func p3(){

}

func main() {
  //p1()

  //p2()
}
